/*
multiboot.h
多重引导头文件
更改自多重引导规范中的示例代码，更改了一些名称，删除了一些xinix认为用不到的东西
这段代码仅适用于ELF格式的可执行文件，如果是其它体系，可能没有办法正确运行
如果想了解更多关于多重引导的东西，可以直接下载多重引导规范参考
Copyright (c) 2018 by Loganx.
*/

#ifndef XINIX_MULTIBOOT_H
#define XINIX_MULTIBOOT_H

#define MULTIBOOT_HEADER_MAGIC 0x1badb002
#define MULTIBOOT_HEADER_FLAGS 0x00000003
#define MULTIBOOT_BOOTLOADER_MAGIC 0x2badb002

typedef struct strMultibootHeader{
    unsigned long magic;
    unsigned long flags;
    unsigned long checksum;
}MultibootHeader,*pMbH;

typedef struct strMultibootInfo{
    unsigned long flags;
    unsigned long mem_lower;
    unsigned long mem_upper;
    unsigned long boot_device;
    unsigned long cmdline;
    unsigned long mods_count;
    unsigned long mods_addr;
    unsigned long unused28;
    unsigned long unused32;
    unsigned long unused36;
    unsigned long unused40;
    unsigned long mmap_length;
    unsigned long mmap_addr;
}MultibootInfo,*pMbI;

typedef struct strMemoryMap{
    unsigned long size;
    unsigned long base_addr_low;
    unsigned long base_addr_high;
    unsigned long length_low;
    unsigned long length_high;
    unsigned long type;
}MemoryMap,*pMM;

unsigned long magic;
pMbI pmbi;

void BootVerify(void);

void PrintLogo(void);

#endif
